package com.example.drug.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import com.example.common.entity.HDoctorNotice;
import com.example.common.support.Result;
import com.example.drug.dto.req.GetUserInfoReq;
import com.example.drug.dto.req.GetWxInfoReq;
import com.example.drug.dto.req.NoticeListReq;
import com.example.drug.dto.resp.PharmacistInfo;
import com.example.drug.service.HomeService;
import com.example.drug.service.LoginService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(tags = "")
@RequestMapping("/api/Home")
public class HomeController {
    
    @Resource
    private HomeService homeService;

    @ApiOperation(value = "首页", notes = "首页")
    @PostMapping(value = "/getIndexMsg")
    public Result<HashMap<String,Object>> getIndexMsg(@RequestHeader Long UID){
        return Result.success(homeService.getIndexMsg(UID));
    }

    @ApiOperation(value = "公告", notes = "公告")
    @PostMapping(value = "/getDoctorNotice")
    public Result<Map<String,Object>> GetDoctorNotice(@RequestBody NoticeListReq noticeListReq){
        return Result.success(homeService.getDoctorNotice(noticeListReq));
    }
    
    @ApiOperation(value = "在线离线状态设置", notes = "在线离线状态设置")
    @PostMapping(value = "/SaveIsOnline")
    public Result<Boolean> SaveIsOnline(@RequestHeader Long UID){
        return Result.success(homeService.SaveIsOnline(UID));
    }

    @ApiOperation(value = "是否自动审方", notes = "是否自动审方")
    @PostMapping(value = "/SaveIsExamine")
    public Result<Boolean> SaveIsExamine(@RequestHeader Long UID){
        return Result.success(homeService.SaveIsExamine(UID));
    }
    
    @ApiOperation(value = "药师信息", notes = "药师信息")
    @PostMapping(value = "/PharmacistMsg")
    public Result<PharmacistInfo> PharmacistMsg(@RequestHeader Long UID){
        return Result.success(homeService.PharmacistMsg(UID));
    }

    @ApiOperation(value = "在线设置", notes = "在线设置")
    @PostMapping(value = "/PharmacistSeting")
    public Result<HashMap<String,Object>> PharmacistSeting(@RequestHeader Long UID){
        return Result.success(homeService.PharmacistSeting(UID));
    }
    
}
